﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using OpenGL;

namespace GLTest
{
	public partial class TestForm : GLForm
	{
		public TestForm()
			: base()
		{
			//InitializeComponent();
		}
		protected override void InitGL()
		{
			T = new GLText("Arial");
			O.GlobalForces.Clear();
			O.GlobalForces.Add(new KeyValuePair<V3D, V3D>(V3D.Red, V3D.Blue));
			O.Process(5);
		}

		protected override void Process(double dt, double tt)
		{
			O.Process(dt);
		}

		GLText T;
		Orientation3D O = new Orientation3D(1);
		protected override bool DrawGLScene()
		{
			MakePerspective(10);
			GL.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT);	// Clear Screen And Depth Buffer
			GL.glLoadIdentity();
			GL.gluLook3D(new V3D(0, 10, 15), new V3D(0, 0.2, 0), new V3D(0, 1, 0));
			GL.glBegin(GL.GL_LINES);
			GL.glCol3D(V3D.Yellow);
			GL.glV3D(V3D.Black);
			GL.glV3D(V3D.White);
			GL.glEnd();
			GL.glMultMatrixd(O.Q.Data);
			GL.glBegin(GL.GL_LINES);
			GL.glCol3D(V3D.Red);
			GL.glV3D(V3D.Black);
			GL.glV3D(V3D.White);
			GL.glEnd();

			return true;
		}
	}
}